<!-- <template>
	<div class="searchview allbgc">
		<form action="/">
			<van-search v-model="inputValue" show-action placeholder="请输入搜索关键词" @search="onSearch" @cancel="onCancel" />
		</form>

		<div class="searchview-histroy">
			<div class="searchview-del" v-show="list.length!=0">
				<span>搜索历史</span>
				<em @click="clear" v-show="list.length!=0">全部删除
					<van-icon name="delete-o" size="15"/>
				</em>
			</div>
			<li v-for="(item,index) in list" :key="index">
				{{ item }}<van-icon name="close" size="14" style="padding-top: 2px;" @click="remove(index)"/>
			</li>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				inputValue: '',
				list: ["111"],
			};
		},
		methods: {
			onSearch(val) {
				if (this.inputValue != '') {
					this.list.push(this.inputValue);
				}
			},
			onCancel() {
				this.$router.push('home')
			},
			remove(index){
				this.list.splice(index, 1);
			},
			clear(){
				this.list = [];
			}
		}
	};
</script>

<style lang="less">
	.searchview-del {
		display: flex;
		justify-content: space-between;
		padding: 14px;
		font-size: 14px;

	}

	.searchview-del em {
		font-style: normal;
	}

	.searchview-histroy {
		background-color: #fff;
	}

	.searchview-histroy li {
		list-style: none;
		display: flex;
		justify-content: space-between;
		margin: 0 14px;
		padding: 14px 0;
		border-top: 1px solid #efefef;
	}
</style> -->